package com.huaxun.edu.web.school;

import java.util.List;

import net.optix.common.app.AppContext;
import net.optix.common.app.BaseAction;
import net.optix.common.app.HLFunction;
import net.optix.common.app.Pager;

import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Namespace;
import org.apache.struts2.convention.annotation.ParentPackage;
import org.apache.struts2.convention.annotation.Result;

import com.huaxun.edu.model.TBE_School;
import com.huaxun.edu.ucc.ISchoolUCC;

@ParentPackage(value = "basic")
@Namespace(value = "/school")
@Action(value = "showSchools", results = { @Result(name = "success", type = "theme", location = "/resource/edu/school/showSchools.html") })
@HLFunction(title = "学校管理", type = "系统管理")
public class ShowSchoolsAction extends BaseAction {

	private List<TBE_School> schools;

	private Pager pager;

	public String execute() {

		if (null == pager || "1".equals(bUpdate)) {
			pager = new Pager();
		}

		ISchoolUCC schoolUCC = AppContext.getService("schoolUCC",
				ISchoolUCC.class);
		schools = schoolUCC.findSchools(pager);
		return success;
	}

	public Pager getPager() {
		return pager;
	}

	public void setPager(Pager pager) {
		this.pager = pager;
	}

	public List<TBE_School> getSchools() {
		return schools;
	}

	public void setSchools(List<TBE_School> schools) {
		this.schools = schools;
	}

}